package com.example.designpattern.behavior.chainofresponbility;

public class SupportServiceImpl implements ISupportService{

	private ISupportService handler;
	@Override
	public void handleRequest(ServiceRequest request) {
		if(ServiceLevel.LEVEL_ONE == request.getLevel()) {
			handler = new HelpDeskServiceImpl();
			handler.handleRequest(request);
		} else if(ServiceLevel.LEVEL_TWO == request.getLevel()) {
			handler = new ITSupportServiceImpl();
			handler.handleRequest(request);
		} else {
			//throw exception
		}
	}
	public ISupportService getHandler() {
		return handler;
	}
	public void setHandler(ISupportService handler) {
		this.handler = handler;
	}

}
